package com.zto.tbschedule.console.vo;

public class Message<T> {
    public static final String LOGIN_TIMEOUT = "LOGIN_TIMEOUT";
    public static final String SYSTEM_ERROR = "SYSTEM_ERROR";
    public static final String SUCCESS = "SUCCESS";
    public static final String ILLEGAL_OPERATION="ILLEGAL_OPERATION";
    public static final String PROCESS_EXCEPTION="PROCESS_EXCEPTION";
    private boolean status;
    private String code;
    private String msg;
    private T data;

    public Message(boolean status,String msg){
        this(status,msg,null);
    }

    public Message(boolean status, String msg, T data) {
        this(status, status?SUCCESS:SYSTEM_ERROR, msg, data);
    }
    public Message(String code,String msg,boolean status){
        this(status,code,msg,null);
    }

    public Message(boolean status, String code, String msg, T data) {
        this.status = status;
        this.code = code;
        this.msg = msg;
        this.data = data;
    }


    public boolean isStatus() {
        return status;
    }

    public void setStatus(boolean status) {
        this.status = status;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
